/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Yacc;

/**
 *
 * @author Administrator
 */
public class Yacc {
    public static void main(String args[]) {
        FirstSet first = new FirstSet();
        first.init();
        FollowSet follow = new FollowSet(first.getFirst(),         // first集合
                first.getNonterminal(),                            // 非终结符集
                first.getOrderProLeft(),first.getOrderProRight()); // 不带选择的生产式
        follow.make();
        follow.printFollow();
        AnalysisTable LL1 = new AnalysisTable(follow.firstSet,follow.followSet,follow.getNonTml(),
                follow.getProLeft(),follow.getProRight());
        boolean flag = LL1.analyse();
        if(flag)System.out.println("ACCEPT!匹配成功");
        else System.out.println("ERROR!匹配失败");
    }
}
